#include "icon.h"

#define CR_ptr Cairo::RefPtr<Cairo::Context>
#define CR_IMG_ptr Cairo::RefPtr<Cairo::ImageSurface>

//virtual-icon-------------------------
//=====================================
//imageIcon----------------------------
//constructs------------
Icons::imageIcon::imageIcon(int fuckyou){
    zLevel(fuckyou);
}
Icons::imageIcon::imageIcon(string fileLoc, int fuckyou){
    img->create_from_png(fileLoc);
    z = fuckyou;
}
Icons::imageIcon::imageIcon(CR_IMG_ptr _img, int fuckyou){
    img = _img;
    z = fuckyou;
}
Icons::imageIcon::~imageIcon(){
}
/* setImage-------------
 * clear the present image
 * the get an existing
 * image, or open on from
 * file
 * -------------------*/
void Icons::imageIcon::setImage(string fileLoc){
    setImage(img->create_from_png(fileLoc));
}
void Icons::imageIcon::setImage(CR_IMG_ptr _img){
    img.clear();
    img = _img;
}
/* draw-----------------
 * place the image on the
 * map
 * -------------------*/
void Icons::imageIcon::draw(CR_ptr cr, int x, int y){
    cr->save();
    cr->set_source(img, x, y);
    cr->paint();
    cr->restore();
}
//=====================================
//vectorIcon---------------------------
//=====================================
//iconLib------------------------------
//=====================================
//iconComp-----------------------------
//=====================================
//iconContainer------------------------
//=====================================